{extend name="$_admin_layout"}

{block name="tpl_vars"}
    {eq name="_request_action" value="create"}
        {php}$page_title = '新建导航';{/php}
    {else /}
        {php}$page_title = '修改导航：' . $nav_info['title'];{/php}
    {/eq}
{/block}

{block name="main-content"}
    <form id="nav_form" class="form form-manager">
        <div class="box box-default no-heading">
            <div class="box-body">

                <div class="row">
                    <div class="col-sm-12">
                        {:helper('admin/form')->render_group('pid', $nav_info['pid'], 'select', '上级', null, array('list' => model('cms/nav')->get_array_tree($group, 0, $nav_info['id']), 'key_field' => 'id', 'title_field' => '_title_show'))}
                        {:helper('admin/form')->render_group('title', $nav_info['title'], 'text', '标题')}
                        {:helper('admin/form')->render_group('sort', $nav_info['sort'], 'text', '排序')}
                        {:helper('admin/form')->render_group('status', $nav_info['status'], 'status', '状态')}
                        {:helper('admin/form')->render_hidden('group', $group)}
                        {:helper('admin/form')->render_submit_and_cancel(request()->url(), $_controller->url('index'))}

                        <script type="text/javascript">
                            $(function(){
                                $('#nav_form').bootstrapValidator({
                                    fields: {
                                        title: {
                                            validators: {
                                                notEmpty: {
                                                    message: '标题不能为空。',
                                                },
                                            },
                                        },
                                    },
                                });
                            });
                        </script>
                    </div>
                </div>

            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </form>
{/block}